<div class='fui-page fui-page-current'>
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click="goback();"></a>
        </div>
        <div class="title">商品管理</div>
        <div class="fui-header-right">
          
        </div>
    </div>
    <!-- 顶部tab -->
    <div id="tab" class="fui-tab fui-tab-success fixed">
       
    </div>
    <div class='fui-content navbar' style="margin-top:2.5rem">
		<div class="searchbar" style='margin:0.3rem;padding:0'>
                    <div class="search-input">
                        <i id="searchsub" class="icon icon-search" ng-click="pagedata.getlist('all')"></i>
                        <input type="search" id='keywords' ng-model="pagedata.params.keyword" placeholder="输入关键字..." style="border: 1px solid #f7f7f7;">
                    </div>
          </div>

        <!-- 商品列表 -->
       <div ng-repeat="item in pagedata.list" class="fui-list-group order-item">
	   <div class="fui-list" >
            <div class="fui-list-media batch-item">
                <input type="checkbox" class="fui-radio fui-radio-success batch-item-check" name="checkbox" value="{{item.id}}" />
            </div>
            <div class="fui-list-media round">
                <img ng-src="{{tomedia(item.image) ||'../core/resource/images/nopic.jpg'}}" class="round"  />
             
                    <div ng-if="item.merchid>0" class="title">多商户</div>
               
            </div>
            <div class="fui-list-inner">
                <div class="title">{{item.title}}</div>
                <div class="subtitle">
                    <span class="price">￥{{item.price}}</span>
                </div>
                <div class="subtitle">
                    <span class="total">库存: {{item.total}}</span>
                    <span class="total">销量: {{item.salenum}}</span>
                </div>
            </div>
		</div>
			<div class="fui-list-group-title" style="margin-bottom:0.3rem">
				<span class="status noremark" style="float:right;">
					<div class="btn btn-sm btn-default-o order-delete" href="javascript:;" ng-click="pagedata.showtotal=true;pagedata.g=item">设置库存</div>
				</span>
            </div>
        </div>
        <div ng-if="pagedata.list==''" class="fui-title center " id="content-empty">没有数据</div>     
    </div>
    <div class="head-menu-mask"></div>
</div>
<div ng-if="pagedata.showtotal" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="border-radius:0.2rem;padding-bottom:3rem;">
			<div class="fui-cell-group">
				<div class="fui-cell">
					<div class="fui-cell-label">设置库存</div>
					<div class="fui-cell-info"><input type="text" class="fui-input" placeholder="设置库存" ng-model="pagedata.g.total"/></div>
				</div>
			</div>
			<div class="fui-navbar">
				<a href="javascript:;" ng-click="pagedata.settotal();pagedata.showtotal=false;" class="nav-item btn btn-danger confirmbtn">确定</a>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
scope.pagedata.settotal=function(){
		scope.post_json('jy_weishop/store.manage.goods/settotal/',scope.pagedata.g,function(res){
				scope.message('设置成功');
		});
}
scope.loading = true;
var page = 1;
var keyword = '';
scope.tool.get_list('jy_weishop/store.manage.goods/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_weishop/store.manage.goods/getlist/');
}
   
</script>
